window.addEventListener('load', function () {
    var tabs = document.querySelector('.tabs').children
    tabs[0].onclick = function () {
        var act = document.querySelector('.account_tab_tab')
        var act2 = document.querySelector('.mobile_tab_tab')
        document.querySelector('.mobile_tab_tab').nextElementSibling.style = "display:block"
        act.style = "display:block"
        act2.style = "display:none"
        this.className = "active"
        tabs[1].className = ""
    }
    tabs[1].onclick = function () {
        var act = document.querySelector('.account_tab_tab')
        var act2 = document.querySelector('.mobile_tab_tab')
        document.querySelector('.mobile_tab_tab').nextElementSibling.style = "display:none"
        act.style = "display:none"
        act2.style = "display:block"
        this.className = "active"
        tabs[0].className = ""
    }
    var res = /^[1][0-9]{10}$/
    var res1=/^[0-9]{6}$/
    // var res1 = /^(?!^\d+$)(?!^[a-zA-Z]+$)[A-Za-z0-9]{6,10}$/
    var dis = document.querySelector('#login_btn')
    dis.onclick = function () {
        var num = document.querySelector('.account input').value
        var pas = document.querySelector('.password input').value
        var num1 = document.querySelector('.mobile input').value
        var pas1 = document.querySelector('.mobile_verify_code input').value

        if (res.test(num) && res.test(pas)) {
            dis.style="background:red !important"
        }
        if(res.test(num1) && res1.test(pas1)) {
            dis.style="background:red !important"
        }
    }
})